package a.i;

import a.c.y;

import java.util.Collection;
import java.util.Iterator;
import java.util.NoSuchElementException;

public final class m
{
  public static int a;
  
  public static Object[] a(y paramy, Object[] paramArrayOfObject)
  {
    boolean bool2 = p.b;
    boolean bool1 = p.a;
    if ((bool2) || (paramArrayOfObject == null)) {
      paramArrayOfObject = new Object[paramy.k()];
    }
    do
    {
      int i = 0;
      while (!bool1)
      {
        if (!paramy.e()) {
          break;
        }
        if ((!bool2) && (bool1)) {
          break label76;
        }
        paramArrayOfObject[i] = paramy.j();
        i++;
        paramy.f();
      }
    } while (bool2);
    label76:
    return paramArrayOfObject;
  }
  
  public static y a(Collection paramCollection)
  {
    return new c_(paramCollection);
  }
  
  public static Iterator a(y paramy)
  {
    return new b_(paramy);
  }
  
  public static Iterator b(y paramy)
  {
    return new a_(paramy);
  }
  
  public static y a(y paramy1, y paramy2)
  {
    return new d_(paramy1, paramy2);
  }
  
  private static class d_
    implements y
  {
    private final y a;
    private final y b;
    private y c;
    
    public d_(y paramy1, y paramy2)
    {
      this.a = paramy1;
      this.b = paramy2;
      h();
    }
    
    public void h()
    {
      boolean bool = p.b;
      this.a.h();
      this.b.h();
      if (!bool) {
        if (this.a.e())
        {
          if (bool) {
            break label61;
          }
          this.c = this.a;
          if (!p.a) {
            return;
          }
        }
      }
      label61:
      this.c = this.b;
    }
    
    public void i()
    {
      boolean bool = p.b;
      this.a.i();
      this.b.i();
      if (!bool) {
        if (this.b.e())
        {
          if (bool) {
            break label61;
          }
          this.c = this.b;
          if (!p.a) {
            return;
          }
        }
      }
      label61:
      this.c = this.a;
    }
    
    public void f()
    {
      boolean bool = p.b;
      this.c.f();
      if (((!bool) && ((!this.c.e()) && (bool))) || (this.c == this.a)) {
        this.c = this.b;
      }
    }
    
    public void g()
    {
      boolean bool = p.b;
      this.c.g();
      if (((!bool) && ((!this.c.e()) && (bool))) || (this.c == this.b)) {
        this.c = this.a;
      }
    }
    
    public boolean e()
    {
      return this.c.e();
    }
    
    public void a()
    {
      f();
      if ((p.b) || (!e())) {
        h();
      }
    }
    
    public void b()
    {
      g();
      if ((p.b) || (!e())) {
        i();
      }
    }
    
    public Object j()
    {
      return this.c.j();
    }
    
    public int k()
    {
      return this.a.k() + this.b.k();
    }
  }
  
  private static final class a_
    implements Iterator
  {
    private final y a;
    
    public a_(y paramy)
    {
      this.a = paramy;
      this.a.i();
    }
    
    public boolean hasNext()
    {
      return this.a.e();
    }
    
    public Object next()
    {
      if ((p.b) || (this.a.e()))
      {
        Object localObject = this.a.j();
        this.a.g();
        return localObject;
      }
      throw new NoSuchElementException();
    }
    
    public void remove()
    {
      throw new UnsupportedOperationException("Removal not supported in Cursors!");
    }
  }
  
  private static final class b_
    implements Iterator
  {
    private final y a;
    
    public b_(y paramy)
    {
      this.a = paramy;
    }
    
    public boolean hasNext()
    {
      return this.a.e();
    }
    
    public Object next()
    {
      if ((p.b) || (this.a.e()))
      {
        Object localObject = this.a.j();
        this.a.f();
        return localObject;
      }
      throw new NoSuchElementException();
    }
    
    public void remove()
    {
      throw new UnsupportedOperationException("Removal not supported in Cursors!");
    }
  }
  
  private static final class c_
    implements y
  {
    private Collection a;
    private Iterator b;
    private boolean c;
    private Object d;
    
    public c_(Collection paramCollection)
    {
      this.a = paramCollection;
      h();
    }
    
    private Object a()
    {
      if (!p.b)
      {
        if (this.c) {
          return this.d;
        }
        this.c = true;
      }
      return this.d = this.b.next();
    }
    
    public Object j()
    {
      return a();
    }
    
    public void f()
    {
      a();
      this.c = false;
    }
    
    public boolean e()
    {
      boolean bool = p.b;
      if (!bool) {
        if (!this.c) {
          if (bool) {
            break label32;
          }
        }
      }
      label32:
      return this.b.hasNext();
    }
    
    public void g()
    {
      throw new UnsupportedOperationException("Not supported (Iterator-backed!)");
    }
    
    public int k()
    {
      return this.a.size();
    }
    
    public void h()
    {
      this.b = this.a.iterator();
      this.c = false;
    }
    
    public void i()
    {
      throw new UnsupportedOperationException("Not supported (Iterator-backed)!");
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.i.m

 * JD-Core Version:    0.7.0.1

 */